package com.xinhe.web.weixin;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@ApiModel(description = "微信支付参数模型")
public abstract class WeixinPayParamModel
{
    @ApiModelProperty("支付费用，元")
    private BigDecimal fee;
    @ApiModelProperty("数据类型")
    private String dataType;
    @ApiModelProperty("数据标识")
    private Long dataId;
    @ApiModelProperty("回调地址")
    private String notifyUrl;
    @ApiModelProperty("支付描述")
    private String body;
    @ApiModelProperty(value = "存放请求参数", hidden = true)
    private Map<String, String> params = new HashMap<>();
    @ApiModelProperty(value = "存放扩展参数", hidden = true)
    private Map<String, String> extendParams = new HashMap<>();
    @ApiModelProperty("交易结束时间")
    private Date timeExpire;
    @ApiModelProperty("openId")
    private String openId;
    @ApiModelProperty("userId")
    private Long userId;

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    protected WeixinPayParamModel() {}

    public WeixinPayParamModel(BigDecimal fee, String dataType, Long dataId, String notifyUrl, String body) {
        this.fee = fee;
        this.dataType = dataType;
        this.dataId = dataId;
        this.notifyUrl = notifyUrl;
        this.body = body;
    }

    public WeixinPayParamModel(BigDecimal fee, String dataType, Long dataId, String notifyUrl, String body, String openId) {
        this.fee = fee;
        this.dataType = dataType;
        this.dataId = dataId;
        this.notifyUrl = notifyUrl;
        this.body = body;
        this.openId = openId;
    }

    public WeixinPayParamModel(BigDecimal fee, String dataType, Long dataId, String notifyUrl, String body, Date timeExpire) {
        this.fee = fee;
        this.dataType = dataType;
        this.dataId = dataId;
        this.notifyUrl = notifyUrl;
        this.body = body;
        this.timeExpire = timeExpire;
    }

    public String getOpenId() {
        return this.openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public Date getTimeExpire() {
        return this.timeExpire;
    }

    public void setTimeExpire(Date timeExpire) {
        this.timeExpire = timeExpire;
    }

    public abstract String getTradeType();

    public void setExtendParam(String key, String value) {
        this.extendParams.put(key, value);
    }

    public Map<String, String> getExtendParams() {
        return this.extendParams;
    }

    public void setExtendParams(Map<String, String> extendParams) {
        this.extendParams = extendParams;
    }

    public BigDecimal getFee() {
        return this.fee;
    }

    public void setFee(BigDecimal fee) {
        this.fee = fee;
    }

    public String getNotifyUrl() {
        return this.notifyUrl;
    }

    public void setNotifyUrl(String notifyUrl) {
        this.notifyUrl = notifyUrl;
    }

    public String getBody() {
        return this.body;
    }

    public void setBody(String body) {
        this.body = body;
    }

    public String getDataType() {
        return this.dataType;
    }

    public void setDataType(String dataType) {
        this.dataType = dataType;
    }

    public Long getDataId() {
        return this.dataId;
    }

    public void setDataId(Long dataId) {
        this.dataId = dataId;
    }

    public Map<String, String> getParams() {
        return this.params;
    }

    public void setParams(Map<String, String> params) {
        this.params = params;
    }
}